Bookmark Property (DataGrid)

       

Returns or sets a bookmark for the specified row within a RowBuffer object in an unbound DataGrid control.

Syntax

object.Bookmark (row) [= value]

The Bookmark property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
row An integer specifying the row where the bookmark is placed. The range of this value can be from 0 to RowCount – 1.
value A variant representing the bookmark for the specified row.

Remarks

Use the value returned by the Bookmark property to save a reference to the current row that remains valid even after another row becomes current.

When you set the Bookmark property to a valid value in code, the row associated with that value becomes the current row, and the grid adjusts its display to bring the new current row into view if necessary.

The Bookmark property is defined as a Variant to accommodate user-defined bookmarks in unbound mode.

In the UnboundReadData event there may be multiple rows, so you must provide a bookmark for each row.

The UnboundWriteData event passes a bookmark to you to identify the row of data to be updated.

The UnboundAddData event passes a bookmark to you to identify the row of data to be added.

Note   In unbound mode, setting the Bookmark property to itself will force the current row to be updated via the UnboundWriteData event.